package com.oa.lms.apps.actions.user;

import java.util.List;

import com.oa.lms.apps.actions.BasicAction;
import com.oa.lms.apps.business.user.ISectionInfoService;
import com.oa.lms.apps.constants.IDEDStatus;
import com.oa.lms.apps.entity.user.SectionInfoValue;


@SuppressWarnings("serial")
public class SectionInfoAction extends BasicAction {

	
	private ISectionInfoService sectionInfoService;
	
	private SectionInfoValue sectionInfo;
	private List<SectionInfoValue> sectionList;
	private String sectionName;
	private String sectionId;
	
	
	public String addSection(){
		
		sectionInfoService.add(sectionName);
		return SUCCESS;
	}
	public String toAdd(){
		
		return SUCCESS;
	}
	
	public String updateSection(){
		
		sectionInfoService.modify(Integer.parseInt(sectionId),sectionName);
		return SUCCESS;
	}
	public String toUpdate(){
		sectionInfo = sectionInfoService.queryBySectionId(Integer.parseInt(sectionId));
		
		return SUCCESS;
	}
	
	public String toQuery(){
		sectionList = sectionInfoService.querySectionInfo(null, IDEDStatus.ENABLE);
		return SUCCESS;
	}
	
	public String toDeleteSection(){
		sectionInfoService.delete(Integer.parseInt(sectionId));
		return SUCCESS;
	}

	public ISectionInfoService getSectionInfoService() {
		return sectionInfoService;
	}

	public void setSectionInfoService(ISectionInfoService sectionInfoService) {
		this.sectionInfoService = sectionInfoService;
	}

	public String getSectionName() {
		return sectionName;
	}

	public void setSectionName(String sectionName) {
		this.sectionName = sectionName;
	}
	public List<SectionInfoValue> getSectionList() {
		return sectionList;
	}
	public void setSectionList(List<SectionInfoValue> sectionList) {
		this.sectionList = sectionList;
	}
	public String getSectionId() {
		return sectionId;
	}
	public void setSectionId(String sectionId) {
		this.sectionId = sectionId;
	}
	public SectionInfoValue getSectionInfo() {
		return sectionInfo;
	}
	public void setSectionInfo(SectionInfoValue sectionInfo) {
		this.sectionInfo = sectionInfo;
	}
	
}
